package Interview;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created by loso on 2017/3/18.
 */
public class
_360_2017318Test3 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int zu = 0;
        int count_zu = 0;
        zu = input.nextInt();
        while(input.hasNext()) {
            int count1 = 0;
            int count2 = 0;
            if(zu>0){
                count_zu++;
                int n = input.nextInt();
                int[] all = new int[n];
                for (int i = 0; i < n; i++) {
                    all[i] = input.nextInt();
                }
                for (int i = 0; i < all.length; i++) {
                    if(i%2 == 1) count1 += all[i];
                    else count2 += all[i];
                }
                if (count1>count2){
                    System.out.println("Case #"+count_zu+": "+ count1+" "+ count2);
                }
                else{
                    System.out.println("Case #"+count_zu+": "+ count2+" "+ count1);
                }
                n = 0;
                n--;
            }else{break;}

        }
    }

}
